package HashSet;

import java.util.*;

public class HashSetDemo {

	public static void main(String[] args) {
		HashSet<String> B = new HashSet<String>();

		B.add("AAA");
		B.add("BBB");
		B.add("CCC");

		for (String s : B) {
			System.out.println(s);
		}

		Stu s1 = new Stu("111", 1);
		Stu s2 = new Stu("112", 2);
		Stu s3 = new Stu("113", 3);
		Stu s4 = new Stu("113", 3);

		HashSet<Stu> A = new HashSet<Stu>();
		A.add(s1);
		A.add(s4);
		A.add(s3);

		Iterator<Stu> it = A.iterator();
		while (it.hasNext()) {
			Stu s = it.next();
			System.out.println(s.getAge() + "," + s.getName());
		}

	}

}
